//
//  RNController2.m
//  NativeAddRN
//
//  Created by 曹阳 on 17/9/5.
//  Copyright © 2017年 9elephas. All rights reserved.
//

#import "RNController2.h"
#import <React/RCTRootView.h>
#import <React/RCTBundleURLProvider.h>


@interface RNController2 ()

@end

@implementation RNController2


- (void)viewDidLoad {
    [super viewDidLoad];
    
    //    NSString * strUrl = @"http://localhost:8081/index.ios.bundle?platform=ios&dev=true";
    
    
    NSURL * jsCodeLocation;
    jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
    
    NSDictionary *props = @{
                            @"username" : @"18026957171",
                            @"password" : @"123456",
                            @"initComponent": @"NativeAddRN2"
                            };
    
    RCTRootView * rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"NativeAddRN2"  initialProperties:props
                                                      launchOptions:nil];
    self.view = rootView;
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    [self.navigationController setNavigationBarHidden:YES animated:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    
    [self.navigationController setNavigationBarHidden:NO animated:animated];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
